﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="fx.aspx.cs" Inherits="ZF.WS.fz.fx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
        <link href="/css/common.css" rel="stylesheet" type="text/css" />
    <link href="/css/default.css" rel="stylesheet" type="text/css" />
    <link href="css/default.css" rel="stylesheet" type="text/css" />

    <script src="/js/jQuery.js" type="text/javascript"></script>

    <script src="../js/jqPlugins/EasyDrag1.4.js" type="text/javascript"></script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    <style>
        #add a{position: absolute; cursor:pointer }
        #add a:hover{ border:1px dashed  #5f8; }
 
    </style>
      <%--<div style="width:100%; height:500px; background:#eee"></div>--%>
      <div style="background:#eee">
      <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0'
        width='780' height='490'>
        <param name='movie' value='/photo/game/<%=this.Buddha.Path %>' />
        <param name='quality' value='high' />
        <param name='wmode' value='transparent' />
        <embed src='/photo/game/<%=this.Buddha.Path %>' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer'
            type='application/x-shockwave-flash' wmode='transparent' width='780' height='490'></embed></object>
      </div>
      
        
      
      <div>
      
          <zf:ListView ID="lvList" runat="server">
              <LayoutTemplate>
                  <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                  </zf:PlaceHolder>
              </LayoutTemplate>
              <ItemTemplate>
                  <img src="/photo/game/<%#Eval("Path") %>" style="position: absolute; left: <%#Eval("X") %>px;
                      top: <%#Eval("Y") %>px" onmousemove="return false;" title="<%#Eval("Name") %>:<%#Eval("Msg") %>" />
              </ItemTemplate>
          </zf:ListView>
      </div>
      <img src="/image/xl.gif" class="SDFSDF" style="   position:absolute; left:<%=this.Buddha.X %>px; top:<%=this.Buddha.Y %>px;" />
      
      
        <div id="add" style="position: absolute; top:  0px; left: 0px; z-index: 1111;    height:490px; width:100%; overflow:hidden">
        </div>

        <script>
            $(".SDFSDF").easydrag();
            $(".SDFSDF").dblclick(function() {
                var x = $(".SDFSDF").css("left").replace("px", "");
                var y = $(".SDFSDF").css("top").replace("px", "");
                var data = String.format("{bid:{0},x:{1},y:{2}}", "", x, y);
                alert(data);
            });
            function add(html,id,x,y) {
                var template = "<a class='rm' bind='{1}' new='1' href='javascript:'>{0}</a>";
                $("#add").append(String.format(template, html, id));
                var rm = $("#add .rm[@new=1]")[0];
                $(rm).attr("new", "0");
                $(rm).css({ left: x, top: y });
                var dragrm = $(rm).easydrag();
                dragrm.ondrop(function() {
                    var point = $.getMousePosition();
                    var x = $(rm).css("left").replace("px", "");
                    var y = $(rm).css("top").replace("px", "");
                    var data = String.format("{bid:{0},x:{1},y:{2}}", $(rm).attr("bind"), x, y);
                    $.ajax({
                        type: "POST",
                        data: data,
                        contentType: "application/json",
                        url: "/WebService.asmx/MoveGP",
                        success: function(msg) {
                        }
                    });
                });
            }
           
        </script>
            
            
        
            
            
    </div>
    </form>
</body>
</html>
